package com.hundsun.yr.universal.library.view.banner;

import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;


/**
 * @Title: ViewPagerScroller.java 
 * @Description: TODO(用一句话描述该文件做什么) 
 * @date 2015-12-3 下午4:54:32 
 * @author:hejun.shen
 * @email:shenhj15971@hundsun.com 
 * @replace author:
 * @replace date:
 * @version V1.0   
 */
public class ViewPagerScroller extends Scroller {

    private double scrollFactor = 1;

    public ViewPagerScroller(Context context) {
        super(context);
    }

    public ViewPagerScroller(Context context, Interpolator interpolator) {
        super(context, interpolator);
    }

    /**
     * 设置持续变化的时间
     */
    public void setScrollDurationFactor(double scrollFactor) {
        this.scrollFactor = scrollFactor;
    }

    @Override
    public void startScroll(int startX, int startY, int dx, int dy, int duration) {
        super.startScroll(startX, startY, dx, dy, (int)(duration * scrollFactor));
    }
}